package base.异常;

import java.util.Scanner;

public class 练习_1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String input = null;
        System.out.println(input);
        while (true) {
            input = sc.nextLine();
            try {
                if (input.length() > 3){
                    throw new LengthOutOfBoundsException("长度超出范围");
                }
                String s = input;
                System.out.println(s);
                break;
            } catch (LengthOutOfBoundsException e) {
                e.printStackTrace();
            }
        }
    }
}
